﻿    (function ($) {
        // Constants
        var FOLDER = $.cleditor.imagesPath() + "icons/",
      STRIP = "icons",
      EXT = ".gif",
      URL = "URL(" + FOLDER + STRIP + EXT + ")",
      BUTTON_COUNT = 12,
      BUTTON_WIDTH = 20,
      BUTTON_HEIGHT = 20;

        // Define the icon button
        $.cleditor.buttons.icon = {
            name: "icon",
            css: {
                backgroundImage: URL,
                backgroundPosition: "2px 2px"
            },
            title: "Insert Icon",
            command: 'inserthtml',
            popupName: "Icon",
            popupHover: true,
            buttonClick: function (e, data) {
                $(data.popup).width(300);
            },
            popupClick: function (e, data) {
                data.value = e.target.innerHTML;
            }
        };

        // Build the popup content

        $.cleditor.buttons.icon.popupContent = '<div class="cled">hi</div>';
        //$.cleditor.buttons.icon.popupContent = $content.children();

        // Add the button to the default controls
        if ($.cleditor.defaultOptions.controls.indexOf("icon") == -1)
            $.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
    .replace("| cut", "icon | cut");

    })(jQuery);
